<include file="Public/header" title="单页列表" />

<div id="page-wrapper">
    
    <div class="row">
        <div class="col-md-6">
            <a href="{:U('Product/add')}" class="btn btn-success">添加货物</a>
        </div>
        <div class="col-md-6">
            <form action="{:U('Product/index')}" method="post">
                <div class="form-group input-group">
                    <input type="text" class="form-control" name="key" placeholder="输入单页标题或者别名关键词搜索">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                    </span>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-hover table-striped">
        <thead>
            <tr>
                <th>编号</th>
                <th>图片名</th>
                <th>商品名</th>
                <th>单价</th>
                <th>尺码</th>
                <th>款式(颜色)</th>
                <th>评论</th>
                <th>热卖</th>
                <th>库存(与否)</th>
            </tr>
        </thead>
        <tbody>
        <foreach name="pro" key="pk" item="pv">

            <tr>
                <td>{$pv.id}</td>
                <td>{$pv.photo}</td>
                <td>{$pv.name}</td>
                <td>${$pv.price}</td>
                <volist name="siz" id="sv" offset="$pk" length="1">
                    <td>
                        <volist name="sv" id="svv">★{$svv}</volist>
                    </td>
                </volist>

                <volist name="col" id="cv" key="ck" offset="$pk" length="1">
                    <td>
                        <volist name="cv" id="cvv">★{$cvv}</volist>
                    </td>
                </volist>

                <volist name="rev" id="rv"  offset="$pk" length="1">
                    <td>
                        <volist name="rv" id="rvv">★{$rvv}</volist>
                    </td>
                </volist>
                <td>
                    <a href="{:U('Product/change',array('id'=>$pv[id],'str'=>'latest'))}">
                        <if condition="$pv.latest eq 1"> 热卖中
                            <else /> 否
                        </if>
                    </a>
                </td>
                <td>
                    <a href="{:U('Product/change',array('id'=>$pv[id],'str'=>'stock'))}">
                        <if condition="$pv.stock eq 1"> 有货
                            <else /> 缺货
                        </if>
                    </a>
                </td>
                <td><a href="{:U('Product/update?id=')}{$v.id}">编辑</a> | <a href="{:U('Product/delete?id=')}{$v.id}" style="color:red;" onclick="javascript:return del('您真的确定要删除吗？\n\n删除后将不能恢复!');">删除</a></td>
            </tr>
        </foreach>
        </tbody>
    </table>
    {$page}
</div>

<include file="Public/footer" />